package ar.republicagroup.gestion.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author DIEGOALV
 */
@Entity
@Table(name = "cliente")
@NamedQueries({
    @NamedQuery(name = "Cliente.findAll", query = "SELECT c FROM Cliente c")})
public class Cliente implements Serializable {
    @OneToMany(mappedBy = "clienteId")
    private List<Caja> cajaList;
    
    
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "telefono")
    private String telefono;
    @Basic(optional = false)
    @Column(name = "direccion")
    private String direccion;
    @Column(name = "email")
    private String email;
    @Column(name = "celular")
    private String celular;
    @Column(name = "nextel")
    private String nextel;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @Column(name = "comision_ba")
    private BigDecimal comisionBa;
    @Basic(optional = false)
    @Column(name = "comision_interior")
    private BigDecimal comisionInterior;
    @Basic(optional = false)
    @Column(name = "comision_rechazo")
    private String comisionRechazo;
    @Column(name = "comision_deposito")
    private BigDecimal comisionDeposito;
    @Basic(optional = false)
    @Column(name = "estado")
    private int estado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "clienteId")
    private List<BolsaCheque> bolsaChequeList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "clienteId")
    private List<Liquidacion> liquidacionList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "clienteId")
    private List<ClienteSaldo> clienteSaldoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "clienteId")
    private List<Deposito> depositoList;
    

    public Cliente() {
    }

    public Cliente(Integer id) {
        this.id = id;
    }

    public Cliente(Integer id, String nombre, String telefono, String direccion, BigDecimal comisionBa, BigDecimal comisionInterior, String comisionRechazo, int estado) {
        this.id = id;
        this.nombre = nombre;
        this.telefono = telefono;
        this.direccion = direccion;
        this.comisionBa = comisionBa;
        this.comisionInterior = comisionInterior;
        this.comisionRechazo = comisionRechazo;
        this.estado = estado;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getTelefono() {
        return telefono;
    }

    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCelular() {
        return celular;
    }

    public void setCelular(String celular) {
        this.celular = celular;
    }

    public String getNextel() {
        return nextel;
    }

    public void setNextel(String nextel) {
        this.nextel = nextel;
    }

    public BigDecimal getComisionBa() {
        return comisionBa;
    }

    public void setComisionBa(BigDecimal comisionBa) {
        this.comisionBa = comisionBa;
    }

    public BigDecimal getComisionInterior() {
        return comisionInterior;
    }

    public void setComisionInterior(BigDecimal comisionInterior) {
        this.comisionInterior = comisionInterior;
    }

    public String getComisionRechazo() {
        return comisionRechazo;
    }

    public void setComisionRechazo(String comisionRechazo) {
        this.comisionRechazo = comisionRechazo;
    }
    
    public BigDecimal getComisionDeposito() {
        return comisionDeposito;
    }

   
    public void setComisionDeposito(BigDecimal comisionDeposito) {
        this.comisionDeposito = comisionDeposito;
    }

    public int getEstado() {
        return estado;
    }

    public void setEstado(int estado) {
        this.estado = estado;
    }

    public List<BolsaCheque> getBolsaChequeList() {
        return bolsaChequeList;
    }

    public void setBolsaChequeList(List<BolsaCheque> bolsaChequeList) {
        this.bolsaChequeList = bolsaChequeList;
    }

    public List<Liquidacion> getLiquidacionList() {
        return liquidacionList;
    }

    public void setLiquidacionList(List<Liquidacion> liquidacionList) {
        this.liquidacionList = liquidacionList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cliente)) {
            return false;
        }
        Cliente other = (Cliente) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return getNombre();
    }

    public List<ClienteSaldo> getClienteSaldoList() {
        return clienteSaldoList;
    }

    public void setClienteSaldoList(List<ClienteSaldo> clienteSaldoList) {
        this.clienteSaldoList = clienteSaldoList;
    }

    public List<Deposito> getDepositoList() {
        return depositoList;
    }

    public void setDepositoList(List<Deposito> depositoList) {
        this.depositoList = depositoList;
    }

    public List<Caja> getCajaList() {
        return cajaList;
    }

    public void setCajaList(List<Caja> cajaList) {
        this.cajaList = cajaList;
    }

  
}
